package com.swsc.solarverse;

/**
 * @Author chencl
 * @Date 2025/1/13 13:45
 * @Version 1.0
 * @Description
 */
@lombok.extern.slf4j.Slf4j
@org.mybatis.spring.annotation.MapperScan({"com.swsc.*.dao"})
@org.springframework.scheduling.annotation.EnableScheduling
@org.springframework.scheduling.annotation.EnableAsync
@org.springframework.boot.web.servlet.ServletComponentScan
@org.springframework.transaction.annotation.EnableTransactionManagement
@org.springframework.boot.autoconfigure.SpringBootApplication(/*exclude= {org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration.class}*/)
public class SolarVerseIuAnalysisApplication extends org.springframework.boot.web.servlet.support.SpringBootServletInitializer implements org.springframework.boot.CommandLineRunner {
    public static void main(String[] args) {
        org.springframework.boot.SpringApplication.run(SolarVerseIuAnalysisApplication.class, args);
    }

    @org.springframework.beans.factory.annotation.Autowired
    private org.springframework.core.env.ConfigurableEnvironment environment;

    @Override
    public void run(String... args) throws Exception {
        org.springframework.core.env.MutablePropertySources propertySources = environment.getPropertySources();
        // 获取所有配置
        java.util.Map<String, String> props = java.util.stream.StreamSupport.stream(propertySources.spliterator(), false).filter(ps -> ps instanceof org.springframework.core.env.EnumerablePropertySource).map(ps -> ((org.springframework.core.env.EnumerablePropertySource) ps).getPropertyNames()).flatMap(java.util.Arrays::stream).distinct().collect(java.util.stream.Collectors.toMap(java.util.function.Function.identity(), environment::getProperty));
        log.info("打印环境变量开始...");
        props.entrySet().stream().forEach(entry -> {
            log.info("{}={}", entry.getKey(), entry.getValue());
        });
        log.info("打印环境变量结束...");
        log.info("SOLAR-VERSE-IU-ANALYSIS服务已启动...");
    }
}
